import Music from "@/pages/Music";
import News from "@/pages/News";
import Play from "@/pages/Play";
import Guonei from "@/pages/News/components/Guonei";
import Guoji from "@/pages/News/components/Guoji";
import Yule from "@/pages/News/components/Yule";
import NotFound from "@/pages/404";
export default [
  //配置默认路由
  {
    path: "/",
    //默认路由配置,一般不会把默认地址直接配置一个组件,而是进行重定向
    // component: News,
    redirect: "/news",
  },
  {
    path: "/news",
    component: News,
    //默认子路由的写法2:在父级路由配置上直接书写重定向(推荐)
    redirect: "/news/guonei",
    children: [
      //默认子路由的写法1:在子路由中额外配置(不推荐)
      /* {
        path: "",
        redirect: "guonei",
      }, */
      {
        /* 二级路由的地址两种方式:1.完整路由地址  2.当前路由地址(不带/) */
        path: "guonei",
        component: Guonei,
      },
      {
        path: "/news/guoji",
        component: Guoji,
      },
      {
        path: "/news/yule",
        component: Yule,
      },
    ],
  },
  {
    path: "/music",
    component: Music,
  },
  {
    path: "/play",
    component: Play,
  },
  //任意路由配置
  //需要写在路由表的最下边,使用通配符 * 匹配所有路径
  {
    path: "*",
    component: NotFound,
  },
];
